﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/QuizAdmin.Master" AutoEventWireup="true" CodeBehind="Position.aspx.cs" Inherits="BladeTecWebApplication.Position" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

<script type="text/javascript">

	function confirmDelete(confirmed) {

		if (!confirmed) {
			$("#dialog-confirm").dialog({
				resizable: false,
				height: 200,
				width: 400,
				modal: true,
				buttons: {
					"Delete Position": function () {
						$(this).dialog("close");
						$("#MainContent_deleteButtonHidden").click();
					},
					Cancel: function () {
						$(this).dialog("close");
					}
				}
			});
			return false;
		} else {
			return true;
		}

	}

</script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<span class="pageTitle">View Positions</span>
<br /><br />

	<asp:Panel cssclass="ui-widget" runat="server" Visible="false" ID="pnlErrorDelete1">
		<div class="ui-state-error ui-corner-all" style="padding: 0 .7em;"> 
			<p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span> 
			<strong>One or more positions could not be deleted because they are still associated with applicants.</strong>
			</p>
		</div>
		<br />
	</asp:Panel>

	<asp:GridView ID="gvPosition" runat="server" AutoGenerateColumns="false" CssClass="netsysTable"
		AlternatingRowStyle-CssClass="netsysTableRowAlt" 
		RowStyle-CssClass="netsysTableRow" BorderStyle="None" BorderWidth="0" 
		>
		<Columns>
			<asp:TemplateField>
				<ItemTemplate>
					<input type="checkbox" name="position_<%#Eval("POSITION_ID") %>" value="<%#Eval("POSITION_ID") %>" />
				</ItemTemplate>
			</asp:TemplateField>
			<asp:BoundField DataField="POSITION_TITLE" HeaderText="Position" />
			<asp:BoundField DataField="HIRE_DATE" HeaderText="Desired Hire Date" DataFormatString="{0:d}" />
			<asp:TemplateField HeaderText="Quiz Name">
				<ItemTemplate>
					<a href="EditQuiz.aspx?quiz_id=<%#Eval("QUIZ_ID") %>"><%#Eval("QUIZ_NAME") %></a>
				</ItemTemplate>
			</asp:TemplateField>
			<asp:TemplateField HeaderText="">
				<ItemTemplate>
					<a href="EditPosition.aspx?position_id=<%#Eval("POSITION_ID") %>">Edit</a>
				</ItemTemplate>
			</asp:TemplateField>
		</Columns>
	</asp:GridView>

	<div style="width:100%; margin-top: 10px;">
		<asp:Button ID="btnDelete" runat="server" Text="Delete Selected" 
			onclick="btnDelete_Click" OnClientClick="return confirmDelete(false);" 
			ClientIDMode="Predictable" />
		<div style="display:none">
			<asp:Button runat="server" OnClick="btnDelete_Click" ID="deleteButtonHidden" ClientIDMode="Predictable"/>
		</div>
	</div>

	<div id="dialog-confirm" title="Confirm Delete" style="display:none;">
		<p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>Are you sure you want to delete the selected positions?</p>
	</div>

</asp:Content>
